#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
int main()
{
	int arr[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
	int len = sizeof(arr) / sizeof(arr[0]);
	int i = 0;
	int tmp = 0;
	int sz = len-1;
	while (i<len)
	{
		while (i<len && arr[i] % 2 == 1)
		{
			i++;
		}
		while (i < len && arr[len] % 2 == 0)
		{
			len--;
		}
		if (i < len)
		{
			tmp = arr[i];
			arr[i] = arr[len];
			arr[len] = tmp;
		}
	}
	for (i = 0; i <= sz; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}